send Command
Sends a command to the local player engine for processing and dispatches it to all registered OnCommandListener instances.
This method is used to issue commands that affect the behavior or state of the current player instance. The command, defined by its name
and arg
, will be processed by the player's internal command handling logic.
All listeners registered via addOnCommandListener will be notified of this command, typically after the controller has initiated processing or queued the command. The exact timing of listener notification relative to command execution may vary.
For sending commands to other devices, see sendRemoteCommand.
Parameters
The non-null, case-sensitive name of the command to send (e.g., "PLAY_CONTENT", "SET_VOLUME", "REBOOT_DEVICE"). Command names are typically defined by the player system.
The argument for the command. This can be null
if the command does not require one. The meaning and format of the argument are specific to the command name
.
See also
Throws
if name
is null.
if name
is empty or if the command name is unrecognized and the system enforces this.